//
//  TopView.m
//  KuWoCan
//
//  Created by hwd on 17/3/6.
//  Copyright © 2017年 hwd. All rights reserved.
//

#import "TopView.h"

@implementation TopView

-(void)AddTopViewPlanNumber:(NSInteger)planNumber RealNumber:(NSInteger)realNumber
{
    self.backgroundColor = [UIColor colorWithHexString:@"#479DE4"];
    _leftBTn = [UIButton buttonWithType:UIButtonTypeCustom];
    _leftBTn.frame = CGRectMake(0,10,80,54);
    [_leftBTn setImage:[UIImage imageNamed:@"back"] forState:UIControlStateNormal];
    //上 左 下 右
    [_leftBTn setImageEdgeInsets:UIEdgeInsetsMake(15,10,10,40)];
    [self addSubview:_leftBTn];
    
    _rightBTn = [UIButton buttonWithType:UIButtonTypeCustom];
    _rightBTn.frame = CGRectMake(SCREENW-80,10,80,54);
    [_rightBTn setTitle:@"明细" forState:UIControlStateNormal];
    [_rightBTn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    _rightBTn.titleLabel.font = [UIFont systemFontOfSize:17*screenW_6];
    //上 左 下 右
    [_rightBTn setTitleEdgeInsets:UIEdgeInsetsMake(15,10,10,15)];
    [self addSubview:_rightBTn];
    
    _titleLab = [TomamaUI createLabel:CGRectMake(80,15,SCREENW-160,50) textAligment:1 font:[UIFont systemFontOfSize:18*screenW_6] textColor:[UIColor whiteColor] text:@"目标完成情况"];
    [self addSubview:_titleLab];

    
    UILabel *planLab = [TomamaUI createLabel:CGRectMake(10*screenW_6, 215*screenW_6, SCREENW/2-20*screenW_6, 25*screenW_6) textAligment:2 font:[UIFont systemFontOfSize:15*screenW_6] textColor:[UIColor colorWithHexString:@"#ffffff"] text:[NSString stringWithFormat:@"目标回款：%ld万",planNumber]];
    [self addSubview:planLab];
    
    
    UILabel *realLab = [TomamaUI createLabel:CGRectMake(SCREENW/2+10*screenW_6, 215*screenW_6, SCREENW/2-20*screenW_6,25*screenW_6) textAligment:0 font:[UIFont systemFontOfSize:15*screenW_6] textColor:[UIColor colorWithHexString:@"#ffffff"] text:[NSString stringWithFormat:@"目标回款：%ld万",realNumber]];
    [self addSubview:realLab];
   
}
@end
